home *** CD-ROM | disk | FTP | other *** search
/ PsL Monthly 1993 December / PSL Monthly Shareware CD-ROM (December 1993).iso / prgmming / dos / c / mg_comm.com / COMM.H < prev    next >
Encoding:
C/C++ Source or Header  |  1990-03-13  |  2.9 KB  |  64 lines

  1. /******************************************************/
  2. /*  COMM.H  - this set of routines is an              */
  3. /*            interupt driven communications          */
  4. /*            interface for MSC 5.1,  QuickC,         */
  5. /*            and TurboC.                             */
  6. /*                                                    */
  7. /*    By  Mario Giannini                              */
  8. /*    Version 1.1  March 12, 1990                     */
  9. /*                                                    */
  10. /*  SetIntr(port) - install driver for com port       */
  11. /*              port where 0 = com1:                  */
  12. /*              returns -1 if port not installed      */
  13. /*                                                    */
  14. /*  ResetInt(port) - remove above driver              */
  15. /*                                                    */
  16. /*  SerAvl() -  tests to see if a character is        */
  17. /*              available in the serial buffer        */
  18. /*                                                    */
  19. /*  GetSer() -  gets a character from the serial      */
  20. /*              buffer                                */
  21. /*                                                    */
  22. /*  PortInit(port, baud, parity, data, stop)          */
  23. /*              returns  0 if ok                      */
  24. /*                      -1 if port not there,         */
  25. /*                      -2 if invalid parameter       */
  26. /*                                                    */
  27. /*  IsCarrier(port) - returns a non-zero if           */
  28. /*                     carrier detect is true         */
  29. /*                                                    */
  30. /*                                                    */
  31. /*  Xmit(ch) -  transmit character ch                 */
  32. /*                                                    */
  33. /*  SendStr(char *Str) - Sends specified string to    */
  34. /*         default Com port.  A '|' is converted to   */
  35. /*         a Carriage Return char, a '~' results in a */
  36. /*         one (about) second delay in transmission.  */
  37. /*                                                    */
  38. /*  HWHangup() - Performs a Hardware hangup by drop-  */
  39. /*     ping the DTR line to the modem for about 1     */
  40. /*     second then restoring it.                      */
  41. /*                                                    */
  42. /*  OneSec() and Delay() - Wait for about 1 second,   */
  43. /*      and Delay() waits for the specified number of */
  44. /*      clock ticks.                                  */
  45. /******************************************************/
  46.  
  47. #define seravl() (tailp!=headp)
  48. #define keyavl() kbhit()
  49.  
  50. int SetIntr(int cport);
  51. int PortInit(int cport, int baud, int parity, int data, int stop);
  52. int GetSer();
  53. int SerAvl();
  54. int IsCarrier();
  55. void SendStr(char *Str);
  56. void Xmit(char ch);
  57. void ResetIntr(int cport);
  58. int ModemStatus();
  59. void HWHangup();
  60. void OneSec();
  61. void Delay(int Len);
  62. void ClearBuffer();
  63. void ClearBuffer();
  64.